package com.jtpay.ysfproductionprocess.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Description: Encryption and decryption model
 * File: EncryptModel.java
 * Author: Administrator
 * Create: 2018/08/16 13:51
 */
public class CryptModel implements Parcelable {
    private int id;
    private String money;//二维码金额
    private String remark;//二维码备注
    private int en_treated;//0 need 1 ok  target db is_ok

    //encrypt type header
    private HeaderModel en_headerModel;
    private EncryptModel en_cryptModel;

    //encrypt type order
    private String en_orderId;//加密后的云闪付订单号
    private String orderId;//云闪付订单号

    //decrypt
    private String qr_content;//加密二维码，云闪付返回的加密后的二维码
    private String de_qr_content;//解密二维码，云闪付返回的解密后的二维码

    // decrypt order
    private String en_content;//加密的云闪付查单返回信息
    private String de_content;//解密后的信息

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getMoney() {
        return money;
    }

    public void setMoney(String money) {
        this.money = money;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public HeaderModel getEn_headerModel() {
        return en_headerModel;
    }

    public void setEn_headerModel(HeaderModel en_headerModel) {
        this.en_headerModel = en_headerModel;
    }

    public EncryptModel getEn_cryptModel() {
        return en_cryptModel;
    }

    public void setEn_cryptModel(EncryptModel en_cryptModel) {
        this.en_cryptModel = en_cryptModel;
    }

    public String getEn_orderId() {
        return en_orderId;
    }

    public void setEn_orderId(String en_orderId) {
        this.en_orderId = en_orderId;
    }

    public int getEn_treated() {
        return en_treated;
    }

    public void setEn_treated(int en_treated) {
        this.en_treated = en_treated;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getQr_content() {
        return qr_content;
    }

    public void setQr_content(String qr_content) {
        this.qr_content = qr_content;
    }

    public String getDe_qr_content() {
        return de_qr_content;
    }

    public void setDe_qr_content(String de_qr_content) {
        this.de_qr_content = de_qr_content;
    }

    public String getEn_content() {
        return en_content;
    }

    public void setEn_content(String en_content) {
        this.en_content = en_content;
    }

    public String getDe_content() {
        return de_content;
    }

    public void setDe_content(String de_content) {
        this.de_content = de_content;
    }

    @Override
    public String toString() {
        return "CryptModel{" +
                "id=" + id +
                ", money='" + money + '\'' +
                ", remark='" + remark + '\'' +
                ", en_treated=" + en_treated +
                ", en_headerModel=" + en_headerModel +
                ", en_cryptModel=" + en_cryptModel +
                ", en_orderId='" + en_orderId + '\'' +
                ", orderId='" + orderId + '\'' +
                ", qr_content='" + qr_content + '\'' +
                ", de_qr_content='" + de_qr_content + '\'' +
                ", en_content='" + en_content + '\'' +
                ", de_content='" + de_content + '\'' +
                '}';
    }

    public CryptModel() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.money);
        dest.writeString(this.remark);
        dest.writeInt(this.en_treated);
        dest.writeParcelable(this.en_headerModel, flags);
        dest.writeParcelable(this.en_cryptModel, flags);
        dest.writeString(this.en_orderId);
        dest.writeString(this.orderId);
        dest.writeString(this.qr_content);
        dest.writeString(this.de_qr_content);
        dest.writeString(this.en_content);
        dest.writeString(this.de_content);
    }

    protected CryptModel(Parcel in) {
        this.id = in.readInt();
        this.money = in.readString();
        this.remark = in.readString();
        this.en_treated = in.readInt();
        this.en_headerModel = in.readParcelable(HeaderModel.class.getClassLoader());
        this.en_cryptModel = in.readParcelable(EncryptModel.class.getClassLoader());
        this.en_orderId = in.readString();
        this.orderId = in.readString();
        this.qr_content = in.readString();
        this.de_qr_content = in.readString();
        this.en_content = in.readString();
        this.de_content = in.readString();
    }

    public static final Creator<CryptModel> CREATOR = new Creator<CryptModel>() {
        @Override
        public CryptModel createFromParcel(Parcel source) {
            return new CryptModel(source);
        }

        @Override
        public CryptModel[] newArray(int size) {
            return new CryptModel[size];
        }
    };
}
